package com.example.module.jump;

import android.app.Activity;
import android.content.Intent;

/**
 * 跳转帮助类
 */

public class ForwardHelper {
	private static ForwardHelper INSTANCE = new ForwardHelper();
	private ForwardToApp forwardToApp;

	public static ForwardHelper getInstance() {
		return ForwardHelper.INSTANCE;
	}

	public void setForwardToApp(ForwardToApp forwardToApp) {
		this.forwardToApp = forwardToApp;
	}

	public void forward(Activity fromActivity, int toActivityId) {
		if (null != forwardToApp) {
			forwardToApp.forward(fromActivity, toActivityId, null);
		}
	}

	public void forward(Activity fromActivity, int toActivityId, Intent intent) {
		if (null != forwardToApp) {
			forwardToApp.forward(fromActivity, toActivityId, intent);
		}
	}
}
